
 <?php 
function embedVideo($url){ 
    if(preg_match("#http://(.*)\.youtube\.com/watch\?v=(.*)(&(.*))?#", $url, $matches)){ 
        ?> 
        <object width="425" height="344"> 
        <param name="movie" value="http://www.youtube.com/v/<?php echo $matches[2];?>&hl=en&fs=1"></param> 
        <param name="allowFullScreen" value="true"></param> 
        <param name="allowscriptaccess" value="always"></param> 
        <embed src="http://www.youtube.com/v/<?php echo $matches[2];?>&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed> 
           </object> 
       <?php 
    }elseif(preg_match("#http://www\.metacafe\.com/watch/(([^/].*)/([^/].*))/?#", $url, $matches)){ 
        ?> 
        <embed flashVars="playerVars=showStats=no|autoPlay=no|videoTitle="  src="http://www.metacafe.com/fplayer/<?php echo $matches[1];?>.swf" width="400" height="348" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed> 
       <?php 
    } 
} 


echo "<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/ScQXy88Cwm4\" frameborder=\"0\" allowfullscreen></iframe>";


?>